<?php

use think\migration\Migrator;
use think\migration\db\Column;

class CompanyPickOrder extends Migrator
{
    /**
     * Change Method.
     *
     * Write your reversible migrations using this method.
     *
     * More information on writing migrations is available here:
     * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
     *
     * The following commands can be used in this method and Phinx will
     * automatically reverse them when rolling back:
     *
     *    createTable
     *    renameTable
     *    addColumn
     *    renameColumn
     *    addIndex
     *    addForeignKey
     *
     * Remember to call "create()" or "update()" and NOT "save()" when working
     * with the Table class.
     */
    public function change()
    {
        $table = $this->table('company_pick_order', ['engine' => 'InnoDB', 'comment' => '公司捡货订单表', 'signed' => false]);
        $table->addColumn('company_id', 'integer', ['limit' => 10, 'default' => 0, 'comment' => '公司id'])
              ->addColumn('company_order_ids', 'string', ['limit' => 500, 'default' => '', 'comment' => '公司订单id集'])
              ->addColumn('pick_order_no', 'string', ['limit' => 50, 'default' => '', 'comment' => '捡货单号'])
              ->addColumn('order_num', 'integer', ['limit' => 10, 'default' => 0, 'comment' => '订单数量'])
              ->addColumn('pick_num', 'integer', ['limit' => 10, 'default' => 0, 'comment' => '应捡货数量'])
              ->addColumn('true_pick_num', 'integer', ['limit' => 10, 'default' => 0, 'comment' => '实际捡货数量'])
              ->addColumn('pick_order_status', 'integer', ['limit' => 10, 'default' => 0, 'comment' => '捡货单状态1:待捡货2:捡货中:3:已捡货:4:已取消'])
              ->addColumn('pick_order_time', 'integer', ['limit' => 10, 'default' => 0, 'comment' => '捡货时间'])
              ->addColumn('create_time', 'integer', ['limit' => 10, 'default' => null, 'comment' => '创建时间'])
              ->addColumn('update_time', 'integer', ['limit' => 10, 'default' => null, 'comment' => '更新时间'])
              ->addColumn('delete_time', 'integer', ['limit' => 10, 'default' => null, 'comment' => '删除时间'])
              ->create();
    }
}
